// JavaScript Document
function sleep (time) {
	return new Promise((resolve) => setTimeout(resolve, time));
}
function OpenDivDeleteCart(show_div,bg_div,item_id){
	document.getElementById(show_div).style.display='block';
	document.getElementById(bg_div).style.display='block';
	document.getElementById('confirmButton').setAttribute("href",'/DeleteCartData?itemId='+item_id);
	sleep(200).then(() => {
		document.getElementById(bg_div).style.transition='0.5s';
		document.getElementById(show_div).style.transition='0.5s';
		document.getElementById(show_div).style.transform='translateY(0px)';
		document.getElementById(show_div).style.opacity='1';
		document.getElementById(bg_div).style.opacity='0.5';
	})

}
function OpenDivAddCart(show_div,bg_div){
	document.getElementById(show_div).style.display='block';
	document.getElementById(bg_div).style.display='block';
	sleep(200).then(() => {
		document.getElementById(bg_div).style.transition='0.5s';
		document.getElementById(show_div).style.transition='0.5s';
		document.getElementById(show_div).style.transform='translateY(0px)';
		document.getElementById(show_div).style.opacity='1';
		document.getElementById(bg_div).style.opacity='0.5';
	})

}
function CloseDiv(show_div,bg_div)
{
	document.getElementById(show_div).style.transform='translateY(30px)';
	document.getElementById(show_div).style.opacity='0';
	document.getElementById(show_div).style.transition='0.5s';
	document.getElementById(bg_div).style.opacity='0';
	document.getElementById(bg_div).style.transition='0.5s';
	sleep(500).then(() => {
		document.getElementById(show_div).style.display='none';
		document.getElementById(bg_div).style.display='none';
	})
};